package cn.com.simple.learning.designpattern.create.singleton;

/**
 * @author Jianxing.Jia
 * @date 2022/2/7
 * @description 单例模式 测试类
 */
public class SingletonTest {

    public static void main(String[] args) {

        // 报错，私有方法不允许其他地方使用
        // SingletonPattern singletonPattern = new SingletonPattern();

        SingletonPattern instance = SingletonPattern.getInstance();
        SingletonPattern instance1 = SingletonPattern.getInstance();

        System.out.println(instance);
        System.out.println(instance1);
        instance.test();
    }
}
